home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / ERROWEE.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  931b  |  42 lines

  1. /*    errowee.c 4.3        */
  2. /*F****************************************************************************
  3.  
  4. FUNCTION NAME:    errowee
  5.  
  6. ACTION:        Erase row of EEPROM at offset into EEPROM provided by addr.
  7.  
  8. PARAMETERS:
  9.         addr:    location of row in EEPROM to be erased. 
  10.  
  11. RETURNS:    (void)
  12.  
  13. ******************************************************************************/
  14.  
  15. #define    EROM_SIZE        512    /* Size of EEPROM */
  16. #define    ERASE_TIME    10    /* number of milliseconds to delay for erase */
  17.  
  18. #include <hc11/io.h>
  19. #include <hc11/config.h>
  20. #include <hc11/directives.h>
  21.  
  22. SMALL
  23. void errowee(addr)
  24.  
  25.     int    addr;        /* row to be erased */
  26.  
  27.     {
  28.  
  29.     HC11.PPROG = EELAT | ERASE | EEROW;
  30.  
  31.     EEPROM[addr&(EROM_SIZE-1)] = 0;
  32.  
  33.     HC11.PPROG = EELAT | ERASE | EEPGM | EEROW;
  34.  
  35.     delay (ERASE_TIME);    /* delay 10 milliseconds */
  36.  
  37.     HC11.PPROG = EELAT | ERASE | EEROW;
  38.  
  39.     HC11.PPROG = 0;    /* enable reads of EEPROM */
  40.  
  41.     }    /* end of errowee */
  42.